<?php

/**
 * experienceEvaluation actions.
 *
 * @package    Timetabler‏
 * @subpackage experienceEvaluation
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class experienceEvaluationActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');

  }



  public function executeEvaluate($request)
  {
   
 // retrive all courses from DB 
    $subjects=array('informaion system','database','parallel computing'); 

    /*$this->form = new sfForm();
    
     //to show the courses 
    for ($i=0 ;$i<3 ; $i++)
      $this->form->setWidget($subjects[$i] , new sfWidgetFormChoice(array(
                              'choices' => array('' => 'select','m' => 'Male','f' => 'Female','d' => 'avg','r' => 'bb','t' => 'nnn'))) );


 

    // to insert the parameters in DB
    for ($i=0 ;$i<3 ; $i++)
   {$choise=$request->getParameter($subjects[$i]);

    //test the choise first and then insert it in DB AS pesentage 
    echo $choise;// repalce withe insert to DB 
    }                                                             */

    $this->form = new ExperienceForm();
 
    if ($request->isMethod('post'))
    {
      $this->form->bind($request->getParameter('contact'));
      if ($this->form->isValid())
      {
        //$this->redirect('contact/index?'.http_build_query($this->form->getValues()));
           
        for ($i=0 ;$i<3 ; $i++)
          // repalce withe insert to DB 
          echo  $this->form->getValue($subjects[$i]);

          echo  $this->form->getValue('Preferable teaching side');

      }
    }


 
    
  

 }//end function 




}// end class 
